<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      margin: 0;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: white;
    }

    .rainbow {
      width: 20em;
      height: 10em;
      position: relative;
      display: flex;
      transition: 1s;
    }

    .rainbow div:nth-child(1) {color: orangered; --n: 1}
    .rainbow div:nth-child(2) {color: orange; --n: 2}
    .rainbow div:nth-child(3) {color: yellow; --n: 3}
    .rainbow div:nth-child(4) {color: mediumspringgreen; --n: 4}
    .rainbow div:nth-child(5) {color: deepskyblue; --n: 5}
    .rainbow div:nth-child(6) {color: mediumpurple; --n: 6}

    .rainbow div {
      box-sizing: border-box;
      flex: 1;
      background-color: currentColor;
      filter: opacity(0.8);
      transition: 0.5s;
      transition-delay: calc(0.1s * var(--n));
    }

    .rainbow:hover {
      align-items: center;
      justify-content: center;
      transform: translateY(5em);
    }

    .rainbow:hover div {
      position: absolute;
      width: calc(100% - 2em * (var(--n) - 1));
      height: calc(200% - 2em * (var(--n) - 1));
      border-radius: 50%;
      background-color: transparent;
      border: 1em solid;
      border-color: transparent currentColor currentColor transparent;
      transform: rotate(225deg);
      filter: opacity(1);
    }
  </style>
</head>
<body>
  <h1 style="color: deepskyblue; margin-right: 3em">请把鼠标放在右侧图形上</h1>
  <div class="rainbow">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</body>
</html>